package com.gscitysfy.cus.drain.modules.inspection.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.gscitysfy.cus.drain.utils.DateUtil;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author 葛守跃
 * @version 1.0.0
 * @ClassName DrainInspectionMnPlanExcel
 * @Description TODO
 * @creatTime 2022/10/17 17:02
 */
@Getter
@Setter
@EqualsAndHashCode
public class DrainInspectionMnPlanExcel implements Serializable {

    /**
     * 计划编号
     */
    @ExcelProperty("计划编号")
    private String cmPlanNo;

    /**
     * 计划名称
     */
    @ExcelProperty("计划名称")
    private String cmPlanName;


    /**
     * 计划开始日期
     */
    @ExcelIgnore()
    private Date cmPlanStartDate;


    public void setCmPlanStartDate(Date cmPlanStartDate) {
        this.cmPlanStartDate = cmPlanStartDate;
        if(Objects.nonNull(cmPlanStartDate)){
            this.cmPlanStartDateDesc = DateUtil.dateToDateString(cmPlanStartDate, "yyyy-MM-dd");
        }
    }


    /**
     * 计划开始日期
     */
    @ExcelProperty("计划开始时间")
    private String cmPlanStartDateDesc;

    /**
     * 计划结束日期
     */
    @ExcelIgnore()
    private Date cmPlanEndDate;

    public void setCmPlanEndDate(Date cmPlanEndDate) {
        this.cmPlanEndDate = cmPlanEndDate;
        if(Objects.nonNull(cmPlanEndDate)){
            this.cmPlanEndDateDesc = DateUtil.dateToDateString(cmPlanEndDate, "yyyy-MM-dd");
        }
    }

    /**
     * 计划结束日期
     */
    @ExcelProperty("计划结束时间")
    private String cmPlanEndDateDesc;

    /**
     * 计划依据
     */
    @ExcelProperty("计划依据")
    private String cmPlanBasis;

    /**
     * 计划类型
     */
    @ExcelProperty("计划类型")
    private String cmPlanType;

    /**
     * 计划巡检对象类别
     */
    @ExcelProperty("计划对象类别")
    private String cmPlanObjectType;

    /**
     * 计划频次
     */
    @ExcelProperty("计划频次")
    private String cmPlanFrequency;

    /**
     * 计划负责人名称
     */
    @ExcelProperty("计划负责人")
    private String cmPlanHeaderName;

    /**
     * 计划负责人电话
     */
    @ExcelProperty("负责人电话")
    private String cmPlanHeaderPhone;

    /**
     * 计划执行人名称，以空格分隔
     */
    @ExcelProperty("计划执行人")
    private String cmPlanExecutorName;

    /**
     * 计划审核状态，0待审核，1审核通过，2审核通过
     */
    @ExcelProperty("审核状态")
    private String cmPlanApprovalStatusDesc;

    /**
     * 计划审核状态，0待审核，1审核通过，2审核不通过
     */
    @ExcelIgnore
    private Integer cmPlanApprovalStatus;

    public void setCmPlanApprovalStatus(Integer cmPlanApprovalStatus) {
        this.cmPlanApprovalStatus = cmPlanApprovalStatus;
        if(cmPlanApprovalStatus == 0){
            this.cmPlanApprovalStatusDesc = "待审核";
        }
        if(cmPlanApprovalStatus == 1){
            this.cmPlanApprovalStatusDesc = "审核通过";
        }
        if(cmPlanApprovalStatus == 2){
            this.cmPlanApprovalStatusDesc = "审核不通过";
        }
    }

    /**
     * 计划审核意见
     */
    @ExcelIgnore
    private String cmPlanApprovalComments;

    /**
     * 审核人名称
     */
    @ExcelIgnore
    private String cmPlanApprovalUsername;

}
